#include "color3.h"

Color3::Color3(float fR, float fG, float fB)
{
    r = fR;
    g = fG;
    b = fB;
}

Color3::Color3(int nR, int nG, int nB)
{
    r = (float)(nR)/255.0f;
    g = (float)(nG)/255.0f;
    b = (float)(nB)/255.0f;
}

Color3 Color3::operator=(float tab[3])
{
    r = tab[0];
    g = tab[1];
    b = tab[2];

    return *this;
}

Color3 Color3::operator=(int tab[3])
{
    r = (float)(tab[0])/255.0f;
    g = (float)(tab[1])/255.0f;
    b = (float)(tab[2])/255.0f;

    return *this;
}

float* Color3::GetTab()
{
    float tab[] = {r, g, b};
    return tab;
}
